# alert.py
import requests
import json

def send_alert(message, webhook="你的钉钉webhook"):
    """最简版告警函数"""
    data = {
        "msgtype": "text",
        "text": {"content": message}
    }
    requests.post(webhook, data=json.dumps(data), headers={'Content-Type': 'application/json'})

# 使用
send_alert("🚨 检测到长事务：耗时12秒，影响5万行",
          webhook="https://oapi.dingtalk.com/robot/send?access_token=abc123...")